<template>
	<div class="container">
		<div class="list-box">
			<el-card>
				<!-- 头部搜素start -->
				<el-form :model="query" ref="queryForm" v-show="showSearch" :inline="true">
					<el-form-item label="模块">
						<common-input v-model="query.a" placeholder="请输入" clearable  />
					</el-form-item>

					<el-form-item>
						<el-button type="primary" icon="el-icon-search" @click="handleQuery">查询</el-button>
						<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
					</el-form-item>
				</el-form>
				<!-- 头部搜素end -->

				<!-- 按钮start -->
				<el-row :gutter="10" class="mb8">
					<el-col :span="1.5">
						<!-- <el-button type="primary" icon="el-icon-refresh-left" @click="edit(null)">本地恢复</el-button> -->
						<el-button type="primary" icon="el-icon-refresh-left">本地恢复</el-button>
					</el-col>

					<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
				</el-row>
				<!-- 按钮end -->

				<!--列表 start-->
				<common-table v-loading="loading" :data="list" @selection-change="handleSelectionChange">
					<!-- <el-table-column type="selection" width="55" align="left" /> -->



					<el-table-column label="模块" align="left" prop="a">
						<template slot-scope="{row}">{{ row.a }}</template>
					</el-table-column>

					<el-table-column label="备份时间" align="left" prop="a">
						<template slot-scope="{row}">{{ row.a }}</template>
					</el-table-column>

					<el-table-column label="操作" align="left" width="200">
						<template slot-scope="{row}">
							<el-button type="text" @click="edit(row)" hasPermi>恢复</el-button>
							<!-- <el-button type="text" @click="edit(row)" hasPermi>新增</el-button> -->
						</template>
					</el-table-column>
				</common-table>

				<pagination v-show="total>0" :total="total" :page.sync="query.pageNum" :limit.sync="query.pageSize" @pagination="getList" />
			</el-card>
			<!-- 列表 end -->
		</div>

		<editDialog ref="editDialog" @refresh="getList" />
	</div>
</template>

<script>
import editDialog from './components/resumeAdd';
export default {
	components: { editDialog },
	props: {},
	data() {
		return {
			filterMenu: '', //菜单筛选
			showSearch: true, // 查询部分显示
			total: 1, // 总条数
			loading: false, // table 加载中
			list: [{ a: 1 }], // 数据列
			selectionIds: '', // 列表选中数据id
			single: true, // 非单个禁用
			multiple: true, // 非多个禁用
			query: {
				pageNum: 1,
				pageSize: 10,
			}, // 查询条件
		};
	},
	watch: {},
	computed: {},
	methods: {
		/**
		 * 选择
		 */
		handleSelectionChange(selection) {
			this.selectionIds = selection.map((item) => item.id);
			this.single = selection.length != 1;
			this.multiple = !selection.length;
		},
		/**
		 * 获取列表
		 */
		getList() {
			let query = { ...this.query };
		},
		/**
		 * 查询
		 */
		handleQuery() {
			this.query.pageNum = 1;
			this.getList();
		},
		/**
		 * 重置查询
		 */
		resetQuery() {
			this.query = this.$options.data().query;
		},
		/**
		 * 添加/编辑
		 */
		edit(row) {
			this.$refs.editDialog.show(row ? { ...row } : {});
		},
		/**
		 * 删除
		 */
		del(ids) {
			this.$GlobalDeleteConfirm().then(() => {
					this.getList();
					this.$GlobalSuccessMessage('删除成功');
				})
				.catch((err) => {});
		},
	},
	created() {},
	mounted() {},
};
</script>
<style lang="scss" scoped>
.container {
  .list-box {
    clear: both;
    height: auto;
    overflow: hidden;
    padding: 20px;
  }
}
</style>
